﻿<UserControl x:Class="Bewise.Phone.JumpList"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
             Loaded="UserControl_Loaded"
    d:DesignHeight="480" d:DesignWidth="480">
	<UserControl.Resources>
		<DataTemplate x:Key="DataTemplate1">
			<Grid>
				<ContentPresenter Margin="0,0,10,0"/>
			</Grid>
		</DataTemplate>
	</UserControl.Resources>
    <Grid x:Name="LayoutRoot">       
        <ListBox x:Name="mainListBox" HorizontalContentAlignment="Stretch" SelectionChanged="mainListBox_SelectionChanged">
            <ListBox.ItemContainerStyle>
                <Style TargetType="ListBoxItem">
                    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                    <Setter Property="HorizontalAlignment" Value="Stretch" />
                    <Setter Property="VerticalContentAlignment" Value="Stretch"/>
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="ListBoxItem">
                                <Grid Height="{Binding Height}" Margin="0,4,0,4" Background="{TemplateBinding Background}" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition/>
                                    </Grid.ColumnDefinitions>
                                	<VisualStateManager.VisualStateGroups>
                                		<VisualStateGroup x:Name="CommonStates">
                                			<VisualState x:Name="Normal"/>
                                			<VisualState x:Name="MouseOver"/>
                                			<VisualState x:Name="Disabled"/>
                                		</VisualStateGroup>
                                	</VisualStateManager.VisualStateGroups>
                                    <Button Width="{Binding HeaderWidth}" Margin="0,0,5,0" Grid.Column="0" Visibility="{Binding IsGroupVisibility}" Click="ButtonLetterClick" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                                        <Button.Template>
                                            <ControlTemplate>
                                                <Grid Background="{StaticResource PhoneAccentBrush}" RenderTransformOrigin="0.5, 0.5" x:Name="GridContent">
                                                    <TextBlock Margin="5" Text="{Binding Text}" FontSize="{StaticResource PhoneFontSizeExtraLarge}" Foreground="{StaticResource PhoneForegroundBrush}" VerticalAlignment="Bottom" HorizontalAlignment="Left"/>
                                                </Grid>
                                            </ControlTemplate>
                                        </Button.Template>
                                    </Button>
                                    <Grid Width="{Binding HeaderWidth}" Grid.Column="0" Margin="0,0,5,0" Visibility="{Binding IsNotGroupAndShowGroupVisibility}">
                                        <Rectangle Fill="{StaticResource PhoneChromeBrush}" Visibility="{Binding HasImageVisibility}"/>
                                        <Image Source="{Binding Image}"/>
                                    </Grid>
                                    <Grid Grid.Column="1" Visibility="{Binding IsNotGroupVisibility}">
                                        <ContentControl x:Name="ContentContainer" Content="{Binding customDataContext.Name}" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
                                    </Grid>
                                </Grid>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </ListBox.ItemContainerStyle>
        </ListBox>
        <Grid Background="{StaticResource PhoneBackgroundBrush}" Opacity="0.8" Visibility="Collapsed" x:Name="waitGrid">
        </Grid>
        <TextBlock Margin="10,0,0,0" TextWrapping="Wrap" x:Name="emptyText" Visibility="Collapsed" VerticalAlignment="Top" />
    </Grid>

</UserControl>
